<?php
namespace Home\Controller;
use Think\Controller;

class CourseController extends PublicController {
    public function courselist(){
    	$course=M('course');
    	$course=$course->join('club ON club.clubid=course.club')->select();//查看club表里俱乐部的id等于course表里所属俱乐部字段的内容
    	$this->assign("course",$course);
        $this->display();
    }
    //删除课程：王子恒
    public function delete(){
        $id=$_GET['courseid'];
        $course=M('course');
        $course=$course->where("courseid=$id")->delete();
        if($course=1){
            $this -> success('删除成功！','');
        }else{
            $this->error('删除失败！','');
        }
    }
}

